<div>
  <form class="form-horizontal" role="form" novalidate name="myForm" ng-init="initQuery()">
    <div class="form-ctrl md-whiteframe-z1">
      <div class="form-search" style="height:190px;" ng-class="{true: 'shou'}[!flag.state]">
        <div>
          <label>时间</label>
          <md-input-container flex>
            <label>开始时间</label>
            <input type="date" ng-model="sendData.startTime"   time-validate="day" end-time="sendData.endTime" required
                   name="startDate">
            <div ng-messages="myForm.startDate.$error" >
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
        <div>
          <md-input-container flex>
            <label>结束时间</label>
            <input type="date" ng-model="sendData.endTime"   time-validate="day" start-time="sendData.startTime" required
                   name="endDate">
            <div ng-messages="myForm.endDate.$error" >
              <div ng-message="date">请正确输入时间</div>
              <div ng-message="time-error">开始时间不应大于结束时间</div>
              <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
      <div>
        <label style="width:90px;">衡量指标</label>
        <md-select ng-model="sendData.measureIndexCode" >
          <md-option ng-value="item.measureIndexCode" style="width:190px;"  ng-repeat="item in measureIndexs">{{item.measureIndexName}}</md-option>
        </md-select>
      </div>
      </div>
      <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="flag.arrow" ng-click="flag.state = false"></i>
      <md-button ng-disabled="myForm.$invalid" ng-click="search(sendData)" class="md-fab md-primary md-hue-1" aria-label="Profile">
      <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;"  ng-show="!flag.state"></i>
      <i class="glyphicon glyphicon-search" ng-show="flag.state"></i>
      </md-button>
    </div>
  </form>
  <div class="table-info">
    <switching-button flag="flag" export-url="{{formPrefix}}" export-value="outData"></switching-button>
    <div ng-show="flag.show === 'view'">
      <div id="doc" style="height:450px;"></div>
    </div>
    <div ng-show="flag.show === 'table' && showPrcentage">
      <div class="table-detail" >
        <div class="t_r">
          <table class="table table-bordered">
          <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{send.title}}</caption>
          <thead>
            <tr>
              <th>时间</th>
              <th>业务系统</th>
              <th>{{name.substring(0,4)}}数量( 单位:个)</th>
              <th>{{name}}</th>
            </tr>
          </thead>
            <tbody>
              <tr ng-repeat="item in items">
               <td>{{item.time}}</td>
               <td>{{item.filedName}}</td>
               <td>{{item.filedNum}}</td>
               <td>{{item.percentage}}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div ng-show="flag.show === 'table' && !showPrcentage">
      <div class="table-detail" >
        <div class="t_r">
          <table class="table table-bordered">
          <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{send.title}}</caption>
          <thead>
            <tr>
              <th>时间</th>
              <th>{{send.measureIndexCode === 'h2004' || send.measureIndexCode === 'h2005' || send.measureIndexCode === 'h2006' ? '业务系统' : '科室'}}</th>
              <th>{{send.measureIndexCode === 'h2001' || send.measureIndexCode === 'h2002' || send.measureIndexCode === 'h2003' ? name+'( 单位:个)' : send.measureIndexCode === 'h2004' || send.measureIndexCode === 'h2005' || send.measureIndexCode === 'h2006' ? name + '( 单位:小时)' : ''}}</th>
            </tr>
          </thead>
            <tbody>
              <tr ng-repeat="item in items">
               <td>{{item.time}}</td>
               <td>{{item.filedName}}</td>
               <td>{{item.filedNum}}</td>
              </tr>
              <tr ng-hide="send.measureIndexCode === 'h2004' || send.measureIndexCode === 'h2005' || send.measureIndexCode === 'h2006'">
                <td>汇总</td>
                <td></td>
                <td>{{totalNum}}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>